/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package wf.model;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;
import java.util.Date;

/**
 *
 * @author alex
 */
@DatabaseTable(tableName="counters_data")
public class CounterData{
    
    @DatabaseField(generatedId=true)
    private int id;
    
    @DatabaseField(canBeNull=false)
    private int counterNumber;
    
    @DatabaseField(canBeNull=false)
    private String plcip;
    
    @DatabaseField(canBeNull=false)
    private Date date;
    
    @DatabaseField(canBeNull=false)
    private int read;

    public CounterData(int id, int counterNumber, String plcip, Date date, int read) {
        this.id = id;
        this.counterNumber = counterNumber;
        this.plcip = plcip;
        this.date = date;
        this.read = read;
    }

    public CounterData() {
    }

    public int getCounterNumber() {
        return counterNumber;
    }

    public Date getDate() {
        return date;
    }

    public String getPlcip() {
        return plcip;
    }

    public int getRead() {
        return read;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public void setCounterNumber(int counterNumber) {
        this.counterNumber = counterNumber;
    }

    public void setId(int id) {
        this.id = id;
    }

    public void setPlcip(String plcip) {
        this.plcip = plcip;
    }

    public void setRead(int read) {
        this.read = read;
    }
    
    @Override
    public String toString() {
        return "Counter: " + this.counterNumber + " Data: \r\n" +
                "Time: " + this.date.toString() + "\r\n" +
                "Belongs to PLC: " + plcip + "\r\n" +
                "Read: " + read + "\r\n--------------------------------------------\r\n";
    }

}
